/*
 *  Copyright 2019-2020 Zheng Jie
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *  http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */
package com.fzhucc.modules.sendDataToQz.controller;

import com.fzhucc.annotation.Log;
import com.fzhucc.annotation.rest.AnonymousGetMapping;
import com.fzhucc.annotation.rest.AnonymousPostMapping;
import com.fzhucc.modules.SendPro.dto.SendProDto;
import com.fzhucc.modules.SendPro.service.SendProService;
import com.fzhucc.modules.sendDataToQz.service.SendToQzService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpStatus;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author yyg
 * @date 2023-08-22
 */
@RestController
@RequiredArgsConstructor
@Api(tags = "发送数据至全总")
@RequestMapping("/api/sendToQz")
public class SendDataToQzController {

    private final SendToQzService sendToQzService;

    @ApiOperation("发送项目数据至全总 劳模新增")
    @Log("发送项目数据至全总 劳模新增")
    @AnonymousGetMapping(value = "/sendModel")
    public ResponseEntity<Object> sendModel() throws Exception {
        String str = sendToQzService.getModelToQzBySevenTimeTest();
        return new ResponseEntity<>(str, HttpStatus.OK);
    }

    @ApiOperation("发送项目数据至全总 企业需求")
    @Log("发送项目数据至全总 企业需求")
    @AnonymousGetMapping(value = "/sendXq")
    public ResponseEntity<Object> sendXq() throws Exception {
        String str = sendToQzService.getsendXqToQzBySevenTimeTest();
        return new ResponseEntity<>(str, HttpStatus.OK);
    }

    @ApiOperation("发送项目数据至全总 技术服务队")
    @Log("发送项目数据至全总 技术服务队")
    @AnonymousGetMapping(value = "/sendJs")
    public ResponseEntity<Object> sendJs() throws Exception {
        String str = sendToQzService.getsendJsToQzBySevenTimeTest();
        return new ResponseEntity<>(str, HttpStatus.OK);
    }

    @ApiOperation("发送项目数据至全总 需求中的企业信息")
    @Log("发送项目数据至全总 需求中的企业信息")
    @AnonymousGetMapping(value = "/sendXqQy")
    public ResponseEntity<Object> sendXqQy() throws Exception {
        String str = sendToQzService.getsendXqQyToQzBySevenTimeTest();
        return new ResponseEntity<>(str, HttpStatus.OK);
    }

    @ApiOperation("发送项目数据至全总 劳模中的企业信息")
    @Log("发送项目数据至全总 劳模中的企业信息")
    @AnonymousGetMapping(value = "/sendModelQy")
    public ResponseEntity<Object> sendModelQy() throws Exception {
        String str = sendToQzService.getsendModelQyToQzBySevenTimeTest();
        return new ResponseEntity<>(str, HttpStatus.OK);
    }

    @ApiOperation("发送全总图片上传")
    @Log("发送全总图片上传")
    @AnonymousGetMapping(value = "/sendPicToQz")
    public ResponseEntity<Object> sendPicToQz() throws Exception {
        String picName = "李壮斌-20240129110253916.jpg";
        String path = "https://zqxyy.fzzgsc.com/api/file/image/李壮斌-20240129110253916.jpg";
        String str = sendToQzService.sendPicToQz(picName,path);
        return new ResponseEntity<>(str, HttpStatus.OK);
    }

    @ApiOperation("发送全总图片上传2")
    @Log("发送全总图片上传2")
    @AnonymousGetMapping(value = "/sendPicToQz2")
    public ResponseEntity<Object> sendPicToQz2() throws Exception {
        String picName = "ma.png";
        String path = "https://static.wx.fzzgsc.com/static/zqx-h5/banner/ma.png";
        String str = sendToQzService.sendPicToQz(picName,path);
        return new ResponseEntity<>(str, HttpStatus.OK);
    }



    @ApiOperation("发送全总图片上传3")
    @Log("发送全总图片上传3")
    @AnonymousGetMapping(value = "/sendPicToQz3")
    public ResponseEntity<Object> sendPicToQz3() throws Exception {
        String picName = "福州市职工三创劳模工匠助企行服务队-20240129110014502.jpg";
        String path = "https://zqxyy.fzzgsc.com/api/file/image/福州市职工三创劳模工匠助企行服务队-20240129110014502.jpg";
        String str = sendToQzService.sendPicToQz(picName,path);
        return new ResponseEntity<>(str, HttpStatus.OK);
    }



    @ApiOperation("获取全总字典")
    @Log("获取全总字典")
    @AnonymousGetMapping(value = "/getQzDict")
    public ResponseEntity<Object> getQzDict(@RequestParam String dict) throws Exception {
        String str = sendToQzService.getQzDict(dict);
        return new ResponseEntity<>(str, HttpStatus.OK);
    }

    @ApiOperation("获取所属工会全路径")
    @Log("获取所属工会全路径")
    @AnonymousGetMapping(value = "/getQzAllArea")
    public ResponseEntity<Object> getQzAllArea(@RequestParam String name) throws Exception {
        String str = sendToQzService.getQzAllArea(name);
        return new ResponseEntity<>(str, HttpStatus.OK);
    }

    @ApiOperation("获取所在地查询")
    @Log("获取所在地查询")
    @AnonymousGetMapping(value = "/selectAreaByAreaName")
    public ResponseEntity<Object> selectAreaByAreaName(@RequestParam String name) throws Exception {
        String str = sendToQzService.getAreaByAreaName(name);
        return new ResponseEntity<>(str, HttpStatus.OK);
    }

    @ApiOperation("发送项目数据至全总 劳模新增只发送一条")
    @Log("发送项目数据至全总 劳模新增只发送一条")
    @AnonymousGetMapping(value = "/sendModel1")
    public ResponseEntity<Object> sendModel1() throws Exception {
        sendToQzService.rMOne();
        return new ResponseEntity<>(HttpStatus.OK);
    }

    @ApiOperation("发送项目数据至全总 企业需求只发送一条")
    @Log("发送项目数据至全总 企业需求只发送一条")
    @AnonymousGetMapping(value = "/sendXq1")
    public ResponseEntity<Object> sendXq1() throws Exception {
        sendToQzService.rXqOne();
        return new ResponseEntity<>(HttpStatus.OK);
    }

    @ApiOperation("发送项目数据至全总 技术服务队只发送一条")
    @Log("发送项目数据至全总 技术服务队只发送一条")
    @AnonymousGetMapping(value = "/sendJs1")
    public ResponseEntity<Object> sendJs1() throws Exception {
        sendToQzService.rTsOne();
        return new ResponseEntity<>(HttpStatus.OK);
    }

    @ApiOperation("发送项目数据至全总 需求中的企业信息只发送一条")
    @Log("发送项目数据至全总 需求中的企业信息只发送一条")
    @AnonymousGetMapping(value = "/sendXqQy1")
    public ResponseEntity<Object> sendXqQy1() throws Exception {
        sendToQzService.rXqQyOne();
        return new ResponseEntity<>(HttpStatus.OK);
    }

    @ApiOperation("发送项目数据至全总 劳模中的企业信息只发送一条")
    @Log("发送项目数据至全总 劳模中的企业信息只发送一条")
    @AnonymousGetMapping(value = "/sendModelQy1")
    public ResponseEntity<Object> sendModelQy1() throws Exception {
        sendToQzService.rMQyOne();
        return new ResponseEntity<>(HttpStatus.OK);
    }

    @ApiOperation("模拟发送项目数据至全总 劳模中的企业信息只发送一条")
    @Log("模拟发送项目数据至全总 劳模中的企业信息只发送一条")
    @AnonymousGetMapping(value = "/sendModelQyMn")
    public ResponseEntity<Object> sendModelQyMn() throws Exception {
        sendToQzService.rMQyOneMn();
        return new ResponseEntity<>(HttpStatus.OK);
    }

    @ApiOperation("发送项目数据至全总 劳模新增只发送一条 姓名相符的模拟发送")
    @Log("发送项目数据至全总 劳模新增只发送一条 姓名相符的模拟发送")
    @AnonymousGetMapping(value = "/sendModel1Mn")
    public ResponseEntity<Object> sendModel1Mn() throws Exception {
        sendToQzService.rMOneMn();
        return new ResponseEntity<>(HttpStatus.OK);
    }


}